﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WoSoft.PACS.Win.Forms.SubForms
{
    public partial class FrmCheckAppSearch : FrmBase
    {

        /// <summary>
        /// 查询开始时间
        /// </summary>
        public DateTime StartTime { get; private set; }
        public DateTime EndTime { get; private set; }
        public string DepartmentID { get; private set; }
        public string PatientName { get; private set; }
        public int HasApp { get; private set; }
        public int HasBD { get; private set; }
        public int Executeing { get; private set; }
        public int Finish { get; private set; }

        public FrmCheckAppSearch()
        {
            InitializeComponent();
        }

        private void FrmCheckAppSearch_Load(object sender, EventArgs e)
        {
            //加载日期数据
            this.dtStartTime.Value = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
            this.dtEndTime.Value = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1).AddSeconds(-1);

            //加载部门
            this.LoadDepartment(this.cbDepartment);
            this.cbDepartment.SelectedValue = Program.CurrentLoginUser.DepartmentID;
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        //关闭
        private void btnOK_Click(object sender, EventArgs e)
        {
            this.StartTime = this.dtStartTime.Value;
            this.EndTime = this.dtEndTime.Value;
            this.DepartmentID = this.cbDepartment.SelectedValue != null ? this.cbDepartment.SelectedValue.ToString() : "";
            this.PatientName = this.textBoxX1.Text.Trim();

            this.HasApp = this.ckApp.Checked ? 1 : 0;
            this.HasBD = this.ckBD.Checked ? 1 : 0;
            this.Executeing = this.ckExe.Checked ? 1 : 0;
            this.Finish = this.ckFinish.Checked ? 1 : 0;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }


    }
}
